
<div id="chartRevenus" class="relative">
    <h1 class="title-big-01"><?=$LANG["label"]["STATISTICSREVENUSBYDAY"];?></h1>
    <div id="chartRevenusLoadMore">← <?=$LANG["label"]["VIEWDAYAGO"];?></div>
    <div id="chartRevenusAreaAdded">
        <?php include_once '../View/templates/managements/agent/statistics/ct-revenus-day.php'; ?>
    </div>
</div>

<script>
    var url = URL_LODE + '/View/agent-management-thongke.php';
    var noDay = 0;

    $('#chartRevenusLoadMore').click(function() {
        noDay++;
        ajaxLoadChartRevenusDayMore(noDay);
    });

    function ajaxLoadChartRevenusDayMore(noDay) {
        $.ajax({
            url: url,
            type: 'GET',
            beforeSend: function() {
                mb.createloadingTable1('#contentManagement > .overlay-loading');
            },
            data: {
                tab: 'revenusdaybynoday',
                action: 'revenusdaybynoday_ajax',
                noDay: noDay
            },
            success: function(data) {
                $('#chartRevenusAreaAdded').prepend(data);
                mb.destroyloadingTable1();
            }
        });
    }

    $('#chartRevenusAreaAdded').delegate('.chart-revenus-day .close-chart', 'click', function() {
        $(this).closest('.chart-revenus-day').remove();
    });
</script>